package com.shen.mianshi.xinde;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;


public class Main {
	public static void main(String[] args) {
		//内存缓冲区
		BlockingQueue<Message> queue = new LinkedBlockingQueue<Message>(10);
		
		//生产者
		Provider provider = new Provider(queue);
		Thread p = new Thread(provider);
		//消费者
		Thread c = new Thread(new Consumer(queue));
		
		p.start();
		c.start();
		
		try {
			Thread.sleep(500);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		provider.stop();
	}
}
